import json

json_str = """{
    "data": {
        "admin": false,
        "chapterTops": [],
        "coinCount": 60,
        "collectIds": [],
        "email": "2856141212@qq.com",
        "icon": "",
        "id": 131364,
        "nickname": "weixuesong",
        "password": "",
        "publicName": "weixuesong",
        "token": "",
        "type": 0,
        "username": "weixuesong"
    },
    "errorCode": 0,
    "errorMsg": ""
}"""
print(json_str)
print(type(json_str))

# json字符串转python数据类型
json_dict = json.loads(json_str)
print(json_dict)
print(type(json_dict))

info_dict = {'name': '小红', 'age': 18, '对象': None}
print(info_dict)
print(type(info_dict))

# python数据类型转json字符串
info_str = json.dumps(info_dict)
print(info_str)
print(type(info_str))
